package tema8.modello;

/**
 * Un Cerchio
 * @author Alessandro Martinelli
 */
public class Cerchio implements Curva{

	private float r,xc,yc;
	
	public Cerchio(float r, float xc, float yc) {
		super();
		this.r = r;
		this.xc = xc;
		this.yc = yc;
	}
	
	@Override
	public float getTMax() {
		return 1;
	}
	
	@Override
	public float getTMin() {
		return 0;
	}
	
	@Override
	public float getX(float t) {
		return xc+r*(float)Math.cos(2*Math.PI*t);
	}
	
	@Override
	public float getY(float t) {
		return yc+r*(float)Math.sin(2*Math.PI*t);
	}
}
